package com.study.d012Components;

import javafx.application.Application;
import javafx.geometry.Rectangle2D;
import javafx.stage.Screen;
import javafx.stage.Stage;

/**
 *Screen类的使用
 *
 */
public class ScreenMain1 extends Application{
	public static void main(String[] args) {
		launch(args);
	}

	@Override
	public void start(Stage stage) throws Exception {
		Screen screen= Screen.getPrimary();
		//获取整个屏幕的大小
		Rectangle2D rect2D= screen.getBounds();
		System.out.println("最小x的值："+rect2D.getMinX() + "最小y的值：" + rect2D.getMinY());
		System.out.println("最大x的值："+rect2D.getMaxX() + "最大y的值：" + rect2D.getMaxY());

		//获取屏幕可见区域的大小
		Rectangle2D rect= screen.getVisualBounds();
		System.out.println("屏幕宽:" + rect.getWidth() + " 屏幕高：" + rect.getHeight());

		System.out.println("DIP="+screen.getDpi());

		stage.show();
	}
}
